package com.tiza.xiaoyoubao.net;

import com.orhanobut.hawk.Hawk;
import com.tianze.library.utils.Base64;
import com.tianze.library.utils.L;
import com.tiza.xiaoyoubao.app.Constants;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.callback.Callback;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import okhttp3.MediaType;

/**
 * Created by mapple on 17/2/13.
 */

public class ApiHttpClient {

//        private static String URL = "http://www.xybvip.com:8080";
//        public static String URL2 = "http://www.xybvip.com";
    public static String URL = "http://120.55.183.137:8080";
    public static String URL2 = "http://120.55.183.137";
    /**
     * 短信验证
     */
    private static final String SENDSMS = "/sendSms/getSendSms";
    /**
     * 注册
     */
    private static final String REGISTER = "/webzzCmsBuyerInfo/setBuyerInfo";
    /**
     * 登录
     */
    private static final String LOGIN = "/webzzCmsBuyerInfo/getAdminInfo";

    /**
     * 修改密码
     *
     * @return
     */
    public static final String CHANGEPASSWORD = "/webzzCmsBuyerInfo/setPassword";

    /**
     * 佣金收入(佣金收益和本金统计)
     *
     * @return
     */
    public static final String GETBUYERMONEY = "/webzzCmsBuyerMoney/getBuyerMoney";
    /**
     * 佣金收入列表
     *
     * @return
     */
    public static final String SELECTCMI = "/webzzCmsBuyerMoney/selectCmi";

    /**
     * 本金收入列表
     *
     * @return
     */
    public static final String SELECTBALANCE = "/webzzCmsBuyerMoney/selectBalance";
    /**
     * 绑定银行卡信息
     */
    public static final String SETBUYERIDCARD = "/webzzCmsBuyerIdcard/setBuyerIdcard";

    /**
     * 修改用户昵称
     * http://120.55.183.137:8080/webzzCmsBuyerInfo/setNickname?id=&nickname=
     *
     * @return
     */

    public static final String SETNICKNAME = "/webzzCmsBuyerInfo/setNickname";

    /**
     * 修改用户QQ号
     *
     * @return
     */
    public static final String SETQQCARD = "/webzzCmsBuyerInfo/setQQCard";

    /**
     * 修改用户微信号
     *
     * @return
     */
    public static final String SETWECHATCARD = "/webzzCmsBuyerInfo/setwechatCart";

    /**
     * 修改用户头像
     *
     * @return
     */
    public static final String SETAVATAR = "/webzzCmsBuyerInfo/setAvatar";

    /**
     * 绑定银行卡
     *
     * @return
     */
    public static final String SETBUYERBANKINFO = "/webzzCmsBuyerBankinfo/setBuyerBankinfo";

    /**
     * 申诉
     *
     * @return
     */
    public static final String GETSINGLEPAGE = "/webzzCmsBuyerAppeal/getSinglePage";
    /**
     * 修改用户信息
     */
    public static final String SETPASSWORD = "/webzzCmsBuyerInfo/updateBuyerInfo";
    /**
     * 获取任务
     */
    public static final String GETTASKMESSAGEINFO = "/webzzCmsSellerTaskMessageinfo/getTaskMessageinfo";

    /**
     * 已接任务
     */
    public static final String RECEIVEDTASK = "/webzzCmsBuyerTaskStepOne/getTaskStepOne";
    /**
     * 已接任务(特别)
     */
    public static final String TBRECEIVEDTASK = "/webzzCmsSellerTaskEcpinfo/getTaskStepOne";

    /**
     * 被邀请的用户
     */
    public static final String GETINVITEUSER = "/bonus/getInviteUser";

    /**
     * 激活用户已下单
     */
    public static final String GETSELLERINFO = "/webzzCmsSellerInfo/getSellerInfoList";
    /**
     * 激活用户已完成
     */
    public static final String GETSELLERINFOFINISH = "/webzzCmsSellerInfo/getSellerInfoListFinish";
    /**
     * 激活商家已下单
     */
    public static final String GETBUYERINFO = "/webzzCmsBuyerInfo/getBuyerInfoList";
    /**
     * 激活商家已完成
     */
    public static final String GETBUYERINFOFINISH = "/webzzCmsBuyerInfo/getBuyerInfoListFinish";
    /**
     * 获取用户佣金
     */
    public static final String GETBONUS = "/bonus/getBonus";

    /**
     * 佣金收益提现
     */
    public static final String COMMISSIONDEPOSIT = "/webzzCmsBuyerMoney/addBuyerMoneyCash";

    /**
     * 佣金收益提现记录
     */
    public static final String COMMISSIONDEPOSITRECORD = "/webzzCmsBuyerMoney/getBuyerMoneyCash";

    /**
     * 绑定淘宝账号
     *
     * @return
     */

    public static final String SETBUYERTAOBAO = "/webzzCmsBuyerTaobaoController/setBuyerTaobao";


    /**
     * 我的消息
     *
     * @return
     */
    public static final String GETSELLERMSG = "/webzzCmsSellerMsgIndex/getSellerMsgIndex";

    /**
     * 版本更新
     *
     * @return
     */
    public static final String GETVERSION = "/webzzCmsVersion/getVersion";

    /**
     * 更新任务状态
     *
     * @return
     */
    public static final String UPDATETASK = "/webzzCmsSellerTaskMessageinfo/updateWebzzCmsBuyerTaskStepOne";


    /**
     * 获取银行卡信息
     *
     * @return
     */
    public static final String GETBUYERBANKINFO = "/webzzCmsBuyerBankinfo/getBuyerBankinfo";

    /**
     * 获取身份证信息
     *
     * @return
     */
    public static final String GETBUYERIDCARD = "/webzzCmsBuyerIdcard/getBuyerIdcard";

    /**
     * 获取淘宝信息
     *
     * @return
     */
    public static final String GETBUYERTAOBAO = "/webzzCmsBuyerTaobaoController/getBuyerTaobao";

    /**
     * 获取淘宝信息
     *
     * @return
     */
    public static final String GETBUYERTAOBAOTOW = "/webzzCmsBuyerTaobaoController/getBuyerTaobaoTow";

    /**
     * 新增垫付任务1
     */

    public static final String INSERTTASK = "/webzzCmsSellerTaskMessageinfo/insertWebzzCmsBuyerTaskStepOne";

    /**
     * 新增垫付任务2
     */

    public static final String INSERTDIANFUTASK2 = "/webzzCmsSellerTaskMessageinfo/insertWebzzCmsBuyerTaskStepDianfuTwo";

    /**
     * 新增垫付任务3
     *
     * @return
     */

    public static final String INSERTDIANFUTASK3 = "/webzzCmsSellerTaskMessageinfo/insertWebzzCmsBuyerTaskStepDianfuThree";

    /**
     * 新增垫付任务4
     *
     * @return
     */

    public static final String INSERTDIANFUTASK4 = "/webzzCmsSellerTaskMessageinfo/insertWebzzCmsBuyerTaskStepDianfuReceive";

    /**
     * 新增浏览任务2
     *
     * @return
     */

    public static final String INSERTBROWSETASK2 = "/webzzCmsSellerTaskMessageinfo/insertWebzzCmsBuyerTaskStepLiulanTwo";
    /**
     * 取消淘宝审核
     *
     * @return
     */

    public static final String DELETETAOBAOINFO = "/webzzCmsBuyerTaobaoController/deleteBuyerTaobao";

    /**
     * 取消任务
     *
     * @return
     */

    public static final String CANCELTASK = "/webzzCmsBuyerCancelOrderListController/setBuyerCancelOrderList";

    /**
     * 取消超时任务
     *
     * @return
     */
    public static final String SELECTOVER = "/webzzCmsBuyerCancelOrderListController/selectOver";

    /**
     * 查询取消任务（已撤销）
     *
     * @return
     */

    public static final String GETCANCELORDERLIST = "/webzzCmsBuyerCancelOrderListController/getCancelOrderList";

    /**
     * @return
     */

    public static final String SELECTTASKNUMBER = "/webzzCmsSellerTaskMessageinfo/selectTaskNumber";


    /**
     * @return 手机淘宝任务操作2
     */
    public static final String SELECTDIANFUTWO = "/webzzCmsSellerTaskMessageinfo/selcetWebzzCmsBuyerTaskStepDianfuTwo";

    /**
     * @return 手机淘宝任务操作3
     */
    public static final String SELECTDIANFUTHREE = "/webzzCmsSellerTaskMessageinfo/selcetWebzzCmsBuyerTaskStepDianfuThree";
    /**
     * @return 手机淘宝任务操作4
     */
    public static final String SELECTDIANFURECEIVE = "/webzzCmsSellerTaskMessageinfo/selcetWebzzCmsBuyerTaskStepDianfuReceive";

    /**
     * 获取公告信息
     *
     * @return
     */
    public static final String GETNEW = "/webzzCmsNews/getNews";
    /**
     * 特别任务查询列表
     */
    public static final String GETSELLERTASKECPINFOALL = "/webzzCmsSellerTaskEcpinfo/getSellerTaskEcpinfoAll";

    /**
     * 特别任务查询
     */
    public static final String GETSELLERTASKECPINFO = "/webzzCmsSellerTaskEcpinfo/getSellerTaskEcpinfo";
    /**
     * 新增特别任务
     */
    public static final String ADDSELLERTASKECPINFOALL = "/webzzCmsSellerTaskEcpinfo/addSellerTaskEcpinfo";

    public static String getCenterUrl() {
        if (URL == null) {
            URL = Hawk.get(Constants.KEY_CENTER_URL, URL);
        }
        return URL;
    }

    public static void setCenterUrl(String pUrl) {
        URL = pUrl;
        Hawk.put(Constants.KEY_CENTER_URL, pUrl);
    }


    private static void postJson(
            Object tag, String url, Map<String, Object> map, Callback callback
    ) throws JSONException {
        JSONObject jsonParams = new JSONObject();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            //jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
            jsonParams.put(key, String.valueOf(object));
        }
        L.d(url + jsonParams.toString());
        OkHttpUtils.postString()//
                   .tag(tag)//
                   .url(url)//
                   .mediaType(MediaType.parse("application/json; charset=utf-8"))//
                   .content(jsonParams.toString())//
                   .build()//
                   .execute(callback);
    }

    private static void get(
            Object tag, String url, Map<String, Object> map, Callback callback
    ) throws JSONException {
        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
            // jsonParams.put(key,String.valueOf(object));
        }
        L.d(url + jsonParams.toString());
        OkHttpUtils.get()//
                   .tag(tag)//
                   .url(url)//
                   .params(jsonParams)//
                   .build()//
                   .execute(callback);
    }

    private static void get1(
            Object tag, String url, Map<String, Object> map, Callback callback
    ) throws JSONException {
        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            //            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
            jsonParams.put(key, String.valueOf(object));
        }
        L.d(url + jsonParams.toString());
        OkHttpUtils.get()//
                   .tag(tag)//
                   .url(url)//
                   .params(jsonParams)//
                   .build()//
                   .execute(callback);
    }

    private static void post(
            Object tag, String url, Map<String, Object> map, Callback callback
    ) throws JSONException {
        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        L.d(url + jsonParams.toString());
        OkHttpUtils.post()//
                   .tag(tag)//
                   .url(url)//
                   .params(jsonParams)//
                   .build()//
                   .execute(callback);
    }

    private static void post1(
            Object tag, String url, Map<String, Object> map, Callback callback
    ) throws JSONException {
        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, String.valueOf(object));
        }
        L.d(url + jsonParams.toString());
        OkHttpUtils.post()//
                   .tag(tag)//
                   .url(url)//
                   .params(jsonParams)//
                   .build()//
                   .execute(callback);
    }

    private static void get(Object tag, String url, Callback callback) {
        L.d(url);
        OkHttpUtils.get()//
                   .tag(tag)//
                   .url(url)//
                   .build()//
                   .execute(callback);
    }

    /**
     * 验证码
     */
    public static void verify(
            Object tag, String phone, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("phone", phone);
        try {
            get(tag, getCenterUrl() + SENDSMS, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 注册
     */
    public static void register(
            Object tag, String telphone, String password, String inviterID, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("telphone", telphone);
        map.put("password", password);
        map.put("inviterID", inviterID);
        try {
            get(tag, getCenterUrl() + REGISTER, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 登录
     */
    public static void login(
            Object tag, String telphone, String password, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("telphone", telphone);
        map.put("password", password);
        try {
            get(tag, getCenterUrl() + LOGIN, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 修改密码
     */
    public static void changePassWord(
            Object tag, String telphone, String password, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("telphone", telphone);
        map.put("password", password);
        try {
            get(tag, getCenterUrl() + CHANGEPASSWORD, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 佣金收入
     */
    public static void getBuyerMoney(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + GETBUYERMONEY, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 佣金收入
     */
    public static void getSelectCmiList(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + SELECTCMI, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 佣金收入
     */
    public static void getSelectBalanceList(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + SELECTBALANCE, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 绑定银行卡信息
     */
    public static void setBuyerIdCard(
            Object tag, String realname, File imageStr, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("realname", realname);
        map.put("imageStr", imageStr);
        map.put("userId", userId);

        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        try {
            OkHttpUtils.post()//
                       .addFile("imageStr", "temp.jpg", imageStr)//
                       .url(getCenterUrl() + SETBUYERIDCARD).params(jsonParams).build()//
                       .execute(callback);
        } catch (Exception e) {
            callback.onError(null, e);
        }
    }

    /**
     * 修改用户昵称
     */
    public static void setSetnickName(
            Object tag, String id, String nickname, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("nickname", nickname);
        try {
            get(tag, getCenterUrl() + SETNICKNAME, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 设置用户qq号
     */
    public static void setQQcard(
            Object tag, String id, String qqCard, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("qqCard", qqCard);
        try {
            get(tag, getCenterUrl() + SETQQCARD, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 设置用户微信号
     */
    public static void setWechatCard(
            Object tag, String id, String wechatCart, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("wechatCart", wechatCart);
        try {
            get(tag, getCenterUrl() + SETWECHATCARD, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 绑定银行卡
     * account   银行账号
     * holder    开户人
     * bankName    银行名称
     * city    开户地
     * cityBank   开户银行名称
     * userId    用户id
     */
    public static void setBuyerBankInfo(
            Object tag, String account, String holder, String bankName, String city,
            String cityBank, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("account", account);
        map.put("holder", holder);
        map.put("bankName", bankName);
        map.put("city", city);
        map.put("cityBank", cityBank);
        map.put("userId", userId);
        try {
            post(tag, getCenterUrl() + SETBUYERBANKINFO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 修改头像
     */
    public static void setAvatar(
            Object tag, String telphone, File avatar, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("telphone", telphone);
        map.put("avatar", avatar);

        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        try {
            OkHttpUtils.post()//
                       .addFile("avatar", "temp.jpg", avatar)//
                       .url(getCenterUrl() + SETAVATAR).params(jsonParams).build()//
                       .execute(callback);
        } catch (Exception e) {
            callback.onError(null, e);
        }
    }

    /**
     * 申诉
     * userId   用户id
     * type     buyer发起的 seller收到的
     */
    public static void getSinglePage(
            Object tag, String userId, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("type", type);
        try {
            get(tag, getCenterUrl() + GETSINGLEPAGE, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 修改用户信息
     * <p>
     * telphone   手机号
     * value  密码\昵称\qq号\微信号参数
     * type    1 密码\2昵称\3qq号\4微信号\5手机号
     */
    public static void setUserInfo(
            Object tag, String telphone, String value, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("telphone", telphone);
        map.put("value", value);
        map.put("type", type);
        try {
            get(tag, getCenterUrl() + SETPASSWORD, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 获取任务
     * 1-11
     * 手机淘宝,手机天猫,淘宝特别,电脑淘宝,手机美丽说
     * 手机京东,手机蘑菇街
     * 手机淘宝(浏览收藏,加购物车)
     * 手机天猫(浏览收藏,加购物车)
     * 电脑淘宝浏览
     * 淘宝特别浏览
     */
    public static void getTaskInfo(
            Object tag, String typeId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("typeId", typeId);
        try {
            get(tag, getCenterUrl() + GETTASKMESSAGEINFO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }
    public static void getTaskInfo1(
            Object tag,  Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        try {
            get(tag, getCenterUrl() + GETTASKMESSAGEINFO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }
    /**
     * userId=&typePid=&orderFlag
     * typePid
     * 001垫付 002浏览
     * orderFlag
     * 垫付任务状态  1待操作       3待返款 4发货中 5待完成   6已完成  7 已撤销
     * 浏览任务状态  1待操作       2待确认  3已完成   7已撤销
     */
    public static void receivedTask(
            Object tag, String userId, String typePid, String orderFlag, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("typePid", typePid);
        map.put("orderFlag", orderFlag);
        try {
            get(tag, getCenterUrl() + RECEIVEDTASK, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }
    /**
     * 特别任务
     * userId=&typePid=&orderFlag
     * typePid
     * 001垫付 002浏览
     * orderFlag
     * 垫付任务状态  1待操作       3待返款 4发货中 5待完成   6已完成  7 已撤销
     * 浏览任务状态  1待操作       2待确认  3已完成   7已撤销
     */
    public static void receivedTbTask(
            Object tag, String userId, String typePid, String orderFlag, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("typePid", typePid);
        map.put("orderFlag", orderFlag);
        try {
            get(tag, getCenterUrl() + TBRECEIVEDTASK, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }
    /**
     * 获取被邀请的用户个数
     */
    public static void getInviteUser(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + GETINVITEUSER, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 激活商家已接单
     * 数据类型 1返回size  2返回list
     */
    public static void getSellerinfo(
            Object tag, String userId, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("type", type);
        try {
            get(tag, getCenterUrl() + GETSELLERINFO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 激活商家已完成
     * 数据类型 1返回size  2返回list
     */
    public static void getSellerinfoFinish(
            Object tag, String userId, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("type", type);
        try {
            get(tag, getCenterUrl() + GETSELLERINFOFINISH, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 激活用户已接单
     * 数据类型 1返回size  2返回list
     */
    public static void getBuyerInfo(
            Object tag, String userId, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("type", type);
        try {
            get(tag, getCenterUrl() + GETBUYERINFO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 激活用户已完成
     * 数据类型 1返回size  2返回list
     */
    public static void getBuyerInfoFinish(
            Object tag, String userId, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("type", type);
        try {
            get(tag, getCenterUrl() + GETBUYERINFOFINISH, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 获取用户佣金
     */
    public static void getBonus(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + GETBONUS, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }


    /**
     * userID=&payMoney=&payUser=&payBank=&payTime=&payFlag=&checkTime=&payFlagStr=&payCard=&yue=&type=
     * type  bj和yj
     * 佣金收益提现
     *
     * @return
     */
    public static void commissionDeposit(
            Object tag, String userID, String payMoney, String payUser, String payBank,
            String payTime, String payCard, String yue, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userID", userID);
        map.put("payMoney", payMoney);
        map.put("payUser", payUser);
        map.put("payBank", payBank);
        map.put("payTime", payTime);
        map.put("payCard", payCard);
        map.put("yue", yue);
        map.put("type", type);
        try {
            post(tag, getCenterUrl() + COMMISSIONDEPOSIT, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 佣金收益提现记录
     */

    public static void commissionDepositRecord(
            Object tag, String userId, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("type", type);
        try {
            get(tag, getCenterUrl() + COMMISSIONDEPOSITRECORD, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 绑定淘宝信息
     * userId=&account=&receiver=&recephone=&city=&address=&sex=&age=&reputation=&image1=&image2
     */
    public static void setBuyerTaoBao(
            Object tag, String id, String userId, String account, String receiver, String recephone,
            String city, String address, String sex, String age, String reputation, File image1,
            File image2, File image3, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("userId", userId);
        map.put("account", account);
        map.put("receiver", receiver);
        map.put("recephone", recephone);
        map.put("city", city);
        map.put("address", address);
        map.put("sex", sex);
        map.put("age", age);
        map.put("reputation", reputation);

        //        map.put("image1", image1);
        //        map.put("image2", image2);
        //        map.put("image3", image3);
        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, String.valueOf(object));
        }
        try {
            if (image3 == null) {
                OkHttpUtils.post()//
                           .addFile("image1", "image1.jpg", image1)//
                           .addFile("image2", "image2.jpg", image2)//
                           .url(URL + SETBUYERTAOBAO).params(jsonParams).build()//
                           .execute(callback);
            } else {
                OkHttpUtils.post()//
                           .addFile("image1", "image1.jpg", image1)//
                           .addFile("image2", "image2.jpg", image2)//
                           .addFile("image3", "image3.jpg", image3)//
                           .url(URL + SETBUYERTAOBAO).params(jsonParams).build()//
                           .execute(callback);
            }


        } catch (Exception e) {
            callback.onError(null, e);
        }
    }

    /**
     * 我的消息
     */
    public static void getSellerMsg(
            Object tag, String userId, String type, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("type", type);
        try {
            get(tag, getCenterUrl() + GETSELLERMSG, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 版本更新
     */
    public static void getVersion(Object tag, Callback callback) {
        get(tag, getCenterUrl() + GETVERSION, callback);
    }

    /**
     * 更新任务状态
     *
     * @param tag
     * @param orderFlag
     * @param callback
     */
    public static void setUpdateTask(
            Object tag, String orderid, String orderFlag, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("orderid", orderid);
        map.put("orderFlag", orderFlag);
        try {
            get(tag, getCenterUrl() + UPDATETASK, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 获取银行卡信息
     *
     * @param tag
     * @param userId
     * @param callback
     */
    public static void getBuyerBankInfo(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + GETBUYERBANKINFO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 获取身份证信息
     *
     * @param tag
     * @param userId
     * @param callback
     */
    public static void getBuyerIdCard(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + GETBUYERIDCARD, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 获取淘宝信息
     *
     * @param tag
     * @param userId
     * @param callback
     */
    public static void getBuyerTaoBao(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + GETBUYERTAOBAO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 获取淘宝信息
     *
     * @param tag
     * @param userId
     * @param callback
     */
    public static void getBuyerTaobaoTow(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + GETBUYERTAOBAOTOW, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 新增任务
     *typepid 001 垫付  002 浏览
     * @param tag
     * @param cid
     * @param taskCode
     * @param typepid
     * @param sellerid
     * @param account
     * @param buyerid
     * @param addtime
     * @param endtime
     * @param callback
     */
    public static void insertTask(
            Object tag, String cid, String taskCode, String sellerid, String account,
            String buyerid, String addtime, String endtime, String typepid, String shopid,
            Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("taskCode", taskCode);
        map.put("sellerid", sellerid);
        map.put("account", account);
        map.put("buyerid", buyerid);
        map.put("addtime", addtime);
        map.put("endtime", endtime);
        map.put("typepid", typepid);
        map.put("shopid", shopid);
        try {
            post(tag, getCenterUrl() + INSERTTASK, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 新增垫付任务2
     *
     * @param tag
     * @param cid
     * @param orderid
     * @param buyerid
     * @param payMoney
     * @param imageSearchResult
     * @param imageGoods1
     * @param imageGoods2
     * @param imageIngoods1
     * @param imageIngoods2
     * @param imageIngoodsHeader
     * @param imageChat
     * @param imagePayment
     * @param addtime
     * @param callback
     */
    public static void insertDianFuTask2(
            Object tag, String cid, String orderid, String buyerid, String payMoney,
            File imageSearchResult, File imageGoods1, File imageGoods2, File imageIngoods1,
            File imageIngoods2, File imageIngoodsHeader, File imageIngoodsFooter, File imageChat,
            File imagePayment, String addtime, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("orderid", orderid);
        map.put("buyerid", buyerid);
        map.put("payMoney", payMoney);
        map.put("imageSearchResult", imageSearchResult);
        map.put("imageGoods1", imageGoods1);
        map.put("imageGoods2", imageGoods2);
        map.put("imageIngoods1", imageIngoods1);
        map.put("imageIngoods2", imageIngoods2);
        map.put("imageIngoodsHeader", imageIngoodsHeader);
        map.put("imageIngoodsFooter", imageIngoodsFooter);
        map.put("imageChat", imageChat);
        map.put("imagePayment", imagePayment);
        map.put("addtime", addtime);

        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        try {
            OkHttpUtils.post()//
                       .addFile("imageSearchResult", "imageSearchResult.jpg", imageSearchResult)//
                       .addFile("imageGoods1", "imageGoods1.jpg", imageGoods1)//
                       .addFile("imageGoods2", "imageGoods2.jpg", imageGoods2)//
                       .addFile("imageIngoods1", "imageIngoods1.jpg", imageIngoods1)//
                       .addFile("imageIngoods2", "imageIngoods2.jpg", imageIngoods2)//
                       .addFile("imageIngoodsHeader", "imageIngoodsHeader.jpg",
                                imageIngoodsHeader
                       )//
                       .addFile("imageIngoodsFooter", "imageIngoodsFooter.jpg",
                                imageIngoodsFooter
                       )//
                       .addFile("imageChat", "imageChat.jpg", imageChat)//
                       .addFile("imagePayment", "imagePayment.jpg", imagePayment)//
                       .url(URL + INSERTDIANFUTASK2).params(jsonParams).build()//
                       .execute(callback);
        } catch (Exception e) {
            callback.onError(null, e);
        }
    }

    /**
     * 新增垫付任务2 6张图片
     *
     * @param tag
     * @param cid
     * @param orderid
     * @param buyerid
     * @param payMoney
     * @param imageSearchResult
     * @param imageGoods1
     * @param imageGoods2
     * @param imageIngoods1
     * @param imageIngoods2
     * @param imageIngoodsHeader
     * @param imageFujia1Header
     * @param imageChat
     * @param imagePayment
     * @param addtime
     * @param callback
     */
    public static void insertDianFuTask2Six(
            Object tag, String cid, String orderid, String buyerid, String payMoney,
            File imageSearchResult, File imageGoods1, File imageGoods2, File imageIngoods1,
            File imageIngoods2, File imageIngoodsHeader, File imageIngoodsFooter,
            File imageFujia1Header, File imageFujia1Footer, File imageChat, File imagePayment,
            String addtime, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("orderid", orderid);
        map.put("buyerid", buyerid);
        map.put("payMoney", payMoney);
        map.put("imageSearchResult", imageSearchResult);
        map.put("imageGoods1", imageGoods1);
        map.put("imageGoods2", imageGoods2);
        map.put("imageIngoods1", imageIngoods1);
        map.put("imageIngoods2", imageIngoods2);
        map.put("imageIngoodsHeader", imageIngoodsHeader);
        map.put("imageIngoodsFooter", imageIngoodsFooter);
        map.put("imageFujia1Header", imageFujia1Header);
        map.put("imageFujia1Footer", imageFujia1Footer);
        map.put("imageChat", imageChat);
        map.put("imagePayment", imagePayment);
        map.put("addtime", addtime);

        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        try {
            OkHttpUtils.post()//
                       .addFile("imageSearchResult", "imageSearchResult.jpg", imageSearchResult)//
                       .addFile("imageGoods1", "imageGoods1.jpg", imageGoods1)//
                       .addFile("imageGoods2", "imageGoods2.jpg", imageGoods2)//
                       .addFile("imageIngoods1", "imageIngoods1.jpg", imageIngoods1)//
                       .addFile("imageIngoods2", "imageIngoods2.jpg", imageIngoods2)//
                       .addFile("imageIngoodsHeader", "imageIngoodsHeader.jpg",
                                imageIngoodsHeader
                       )//
                       .addFile("imageIngoodsFooter", "imageIngoodsFooter.jpg",
                                imageIngoodsFooter
                       )//
                       .addFile("imageFujia1Header", "imageFujia1Header.jpg", imageFujia1Header)//
                       .addFile("imageFujia1Footer", "imageFujia1Footer.jpg", imageFujia1Footer)//
                       .addFile("imageChat", "imageChat.jpg", imageChat)//
                       .addFile("imagePayment", "imagePayment.jpg", imagePayment)//
                       .url(URL + INSERTDIANFUTASK2).params(jsonParams).build()//
                       .execute(callback);
        } catch (Exception e) {
            callback.onError(null, e);
        }
    }

    /**
     * 新增垫付任务2 8张图片
     *
     * @param tag
     * @param cid
     * @param orderid
     * @param buyerid
     * @param payMoney
     * @param imageSearchResult
     * @param imageGoods1
     * @param imageGoods2
     * @param imageIngoods1
     * @param imageIngoods2
     * @param imageIngoodsHeader
     * @param imageFujia1Header
     * @param imageFujia1Footer
     * @param imageFujia2Header
     * @param imageChat
     * @param imagePayment
     * @param addtime
     * @param callback
     */
    public static void insertDianFuTask2Eight(
            Object tag, String cid, String orderid, String buyerid, String payMoney,
            File imageSearchResult, File imageGoods1, File imageGoods2, File imageIngoods1,
            File imageIngoods2, File imageIngoodsHeader, File imageIngoodsFooter,
            File imageFujia1Header, File imageFujia1Footer, File imageFujia2Header,
            File imageFujia2Footer, File imageChat, File imagePayment, String addtime,
            Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("orderid", orderid);
        map.put("buyerid", buyerid);
        map.put("payMoney", payMoney);
        map.put("imageSearchResult", imageSearchResult);
        map.put("imageGoods1", imageGoods1);
        map.put("imageGoods2", imageGoods2);
        map.put("imageIngoods1", imageIngoods1);
        map.put("imageIngoods2", imageIngoods2);
        map.put("imageIngoodsHeader", imageIngoodsHeader);
        map.put("imageIngoodsFooter", imageIngoodsFooter);
        map.put("imageFujia1Header", imageFujia1Header);
        map.put("imageFujia1Footer", imageFujia1Footer);
        map.put("imageFujia2Header", imageFujia2Header);
        map.put("imageFujia2Footer", imageFujia2Footer);
        map.put("imageChat", imageChat);
        map.put("imagePayment", imagePayment);
        map.put("addtime", addtime);

        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        try {
            OkHttpUtils.post()//
                       .addFile("imageSearchResult", "imageSearchResult.jpg", imageSearchResult)//
                       .addFile("imageGoods1", "imageGoods1.jpg", imageGoods1)//
                       .addFile("imageGoods2", "imageGoods2.jpg", imageGoods2)//
                       .addFile("imageIngoods1", "imageIngoods1.jpg", imageIngoods1)//
                       .addFile("imageIngoods2", "imageIngoods2.jpg", imageIngoods2)//
                       .addFile("imageIngoodsHeader", "imageIngoodsHeader.jpg",
                                imageIngoodsHeader
                       )//
                       .addFile("imageIngoodsFooter", "imageIngoodsFooter.jpg",
                                imageIngoodsFooter
                       )//
                       .addFile("imageFujia1Header", "imageFujia1Header.jpg", imageFujia1Header)//
                       .addFile("imageFujia1Footer", "imageFujia1Footer.jpg", imageFujia1Footer)//
                       .addFile("imageFujia2Header", "imageFujia2Header.jpg", imageFujia2Header)//
                       .addFile("imageFujia2Footer", "imageFujia2Footer.jpg", imageFujia2Footer)//
                       .addFile("imageChat", "imageChat.jpg", imageChat)//
                       .addFile("imagePayment", "imagePayment.jpg", imagePayment)//
                       .url(URL + INSERTDIANFUTASK2).params(jsonParams).build()//
                       .execute(callback);
        } catch (Exception e) {
            callback.onError(null, e);
        }
    }

    /**
     * 新增垫付任务3
     *
     * @param tag
     * @param cid
     * @param orderid
     * @param sellerid
     * @param buyerid
     * @param payPrice
     * @param addtime
     * @param callback
     */
    public static void insertDianFuTask3(
            Object tag, String cid, String orderid, String sellerid, String buyerid,
            String payPrice, String addtime, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("orderid", orderid);
        map.put("sellerid", sellerid);
        map.put("buyerid", buyerid);
        map.put("payPrice", payPrice);
        map.put("addtime", addtime);
        try {
            post(tag, getCenterUrl() + INSERTDIANFUTASK3, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 新增垫付任务4
     *
     * @param tag
     * @param cid
     * @param orderid
     * @param addtime
     * @param imageRated
     * @param imageReceive
     * @param callback
     */
    public static void insertDianFuTask4(
            Object tag, String cid, String orderid, String addtime, File imageRated,
            File imageReceive, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("orderid", orderid);
        map.put("addtime", addtime);
        map.put("imageRated", imageRated);
        map.put("imageReceive", imageReceive);
        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        try {
            OkHttpUtils.post()//
                       .addFile("imageRated", "imageRated.jpg", imageRated)//
                       .addFile("imageReceive", "imageReceive.jpg", imageReceive)//
                       .url(URL + INSERTDIANFUTASK4).params(jsonParams).build()//
                       .execute(callback);
        } catch (Exception e) {
            callback.onError(null, e);
        }
    }

    /**
     * 新增浏览任务2
     *
     * @param tag
     * @param cid
     * @param orderid
     * @param buyerid
     * @param imageSearchResult
     * @param imageGoodsHeader
     * @param imageGoodsFooter
     * @param imageStoreGoods
     * @param imageAddShoppingcart
     * @param imageStoreShop
     * @param addtime
     * @param callback
     */
    public static void insertBrowseTask2(
            Object tag, String cid, String orderid, String buyerid, File imageSearchResult,
            File imageGoodsHeader, File imageGoodsFooter, File imageStoreGoods,
            File imageAddShoppingcart, File imageStoreShop, String addtime, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("orderid", orderid);
        map.put("buyerid", buyerid);
        map.put("imageSearchResult", imageSearchResult);
        map.put("imageGoodsHeader", imageGoodsHeader);
        map.put("imageGoodsFooter", imageGoodsFooter);
        map.put("imageStoreGoods", imageStoreGoods);
        map.put("imageAddShoppingcart", imageAddShoppingcart);
        map.put("imageStoreShop", imageStoreShop);
        map.put("addtime", addtime);

        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        try {
            OkHttpUtils.post()//
                       .addFile("imageSearchResult", "imageSearchResult.jpg", imageSearchResult)//
                       .addFile("imageGoodsHeader", "imageGoodsHeader.jpg", imageGoodsHeader)//
                       .addFile("imageGoodsFooter", "imageGoodsFooter.jpg", imageGoodsFooter)//
                       .addFile("imageStoreGoods", "imageStoreGoods.jpg", imageStoreGoods)//
                       .addFile("imageAddShoppingcart", "imageAddShoppingcart.jpg",
                                imageAddShoppingcart
                       )//
                       .addFile("imageStoreShop", "imageStoreShop.jpg", imageStoreShop)//
                       .url(URL + INSERTDIANFUTASK2).params(jsonParams).build()//
                       .execute(callback);
        } catch (Exception e) {
            callback.onError(null, e);
        }
    }

    /**
     * 取消淘宝审核
     */
    public static void deleteTaoBaoInfo(
            Object tag, String id, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        try {
            get(tag, getCenterUrl() + DELETETAOBAOINFO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }


    /**
     * @param tag
     * @param cid
     * @param orderid
     * @param taskCode
     * @param addTime
     * @param reason
     * @param buyerID
     * @param typePid
     * @param account
     * @param sellerID
     * @param type
     * @param callback
     */
    public static void cancelTak(
            Object tag, String cid, String orderid, String taskCode, String addTime, String reason,
            String buyerID, String typePid, String account, String sellerID, String type,
            Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("orderid", orderid);
        map.put("taskCode", taskCode);
        map.put("addTime", addTime);
        map.put("reason", reason);
        map.put("buyerID", buyerID);
        map.put("typePid", typePid);
        map.put("account", account);
        map.put("sellerID", sellerID);
        map.put("type", type);
        try {
            post1(tag, getCenterUrl() + CANCELTASK, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 取消超时的任务
     *
     * @param tag
     * @param callback
     */
    public static void selectOver(
            Object tag, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        try {
            post(tag, getCenterUrl() + SELECTOVER, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 取消任务查询（已撤销）
     */
    public static void getCancelOrderList(
            Object tag, String userId, String typePid, String orderFlag, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        map.put("typePid", typePid);
        map.put("orderFlag", orderFlag);
        try {
            get(tag, getCenterUrl() + GETCANCELORDERLIST, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }


    /**
     * 获取淘宝号接单数量
     */
    public static void selectTaskNumber(
            Object tag, String userId, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", userId);
        try {
            get(tag, getCenterUrl() + SELECTTASKNUMBER, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * @param tag
     * @param orderid
     * @param callback
     */
    public static void selectDianFuTwo(
            Object tag, String orderid, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("orderid", orderid);
        try {
            post(tag, getCenterUrl() + SELECTDIANFUTWO, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * @param tag
     * @param orderid
     * @param callback
     */
    public static void selectDianFuThree(
            Object tag, String orderid, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("orderid", orderid);
        try {
            post(tag, getCenterUrl() + SELECTDIANFUTHREE, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * @param tag
     * @param orderid
     * @param callback
     */
    public static void selectDianFuReceive(
            Object tag, String orderid, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("orderid", orderid);
        try {
            post(tag, getCenterUrl() + SELECTDIANFURECEIVE, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 获取新闻公告
     */
    public static void getNews(Object tag, Callback callback) {
        get(tag, getCenterUrl() + GETNEW, callback);
    }

    /**
     * 特别任务查询列表
     *
     * @param tag
     * @param callback
     */
    public static void getSellerTaskEcpinfoAll(
            Object tag, Callback callback
    ) {
        get(tag, getCenterUrl() + GETSELLERTASKECPINFOALL, callback);
    }

    /**
     * 增加特别任务
     */
    public static void addSellerTaskEcpinfoAll(
            Object tag, String endDate, String entranceName, String intervalTask, String intervals,
            String message, String mobilePrice, int number, int number2, int number3, int orders,
            String price, String price2, String price3, String remarks, String scannSetting,
            int settingTime, String spbaoyou, String startDate, String tcode, String tlink,
            String url, String url2, String url3, String taskEntrance, String keywords,
            String title, String userid, String taskCode, String images, String images2,
            String images3, String stepImage1, String stepImage2, String stepImage3,
            String stepImage4, String stepImage5, String imagesThumb, String images2Thumb,
            String images3Thumb, String stepImage1Thumb, String stepImage2Thumb,
            String stepImage3Thumb, String stepImage4Thumb, String stepImage5Thumb,
            Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("endDate", endDate);
        map.put("entranceName", entranceName);
        map.put("intervalTask", intervalTask);
        map.put("intervals", intervals);
        map.put("message", message);
        map.put("mobilePrice", mobilePrice);
        map.put("number", number);
        map.put("number2", number2);
        map.put("number3", number3);
        map.put("orders", orders);
        map.put("price", price);
        map.put("price2", price2);
        map.put("price3", price3);
        map.put("remarks", remarks);
        map.put("scannSetting", scannSetting);
        map.put("settingTime", settingTime);
        map.put("spbaoyou", spbaoyou);
        map.put("startDate", startDate);
        map.put("tcode", tcode);
        map.put("tlink", tlink);
        map.put("url", url);
        map.put("url2", url2);
        map.put("url3", url3);
        map.put("taskEntrance", taskEntrance);
        map.put("keywords", keywords);
        map.put("title", title);
        map.put("userid", userid);
        map.put("taskCode", taskCode);
        map.put("images", images);
        map.put("images2", images2);
        map.put("images3", images3);
        map.put("stepImage1", stepImage1);
        map.put("stepImage2", stepImage2);
        map.put("stepImage3", stepImage3);
        map.put("stepImage4", stepImage4);
        map.put("stepImage5", stepImage5);
        map.put("imagesThumb", imagesThumb);
        map.put("images2Thumb", images2Thumb);
        map.put("images3Thumb", images3Thumb);
        map.put("stepImage1Thumb", stepImage1Thumb);
        map.put("stepImage2Thumb", stepImage2Thumb);
        map.put("stepImage3Thumb", stepImage3Thumb);
        map.put("stepImage4Thumb", stepImage4Thumb);
        map.put("stepImage5Thumb", stepImage5Thumb);
        try {
            postJson(tag, getCenterUrl() + ADDSELLERTASKECPINFOALL, map, callback);
        } catch (JSONException e) {
            callback.onError(null, e);
        }
    }

    /**
     * 新增垫付任务2
     *
     * @param tag
     * @param cid
     * @param orderid
     * @param buyerid
     * @param payMoney
     * @param addtime
     * @param callback
     */
    public static void insertDianFuTBTask(
            Object tag, String cid, String orderid, String buyerid, String payMoney, File imageIngoodsHeader,File imageIngoodsFooter,
            File imagePayment, String addtime, Callback callback
    ) {
        Map<String, Object> map = new HashMap<>();
        map.put("cid", cid);
        map.put("orderid", orderid);
        map.put("buyerid", buyerid);
        map.put("payMoney", payMoney);
        map.put("addtime", addtime);
        Map<String, String> jsonParams = new HashMap<>();
        for (String key : map.keySet()) {
            Object object = map.get(key);
            jsonParams.put(key, Base64.encodeBase64Url(String.valueOf(object)));
        }
        try {
            OkHttpUtils.post()//
                       .addFile("imageIngoodsHeader", "imageIngoodsHeader.jpg", imageIngoodsHeader)//
                       .addFile("imageIngoodsFooter", "imageIngoodsFooter.jpg", imageIngoodsFooter)//
                       .addFile("imagePayment", "imagePayment.jpg", imagePayment)//
                       .url(URL + INSERTDIANFUTASK2).params(jsonParams).build()//
                       .execute(callback);
        } catch (Exception e) {
            callback.onError(null, e);
        }
    }
}
